/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package agent;

import java.util.ArrayList;

/**
 *
 * @author chuda
 */
public class Agent {
    private String ip = "";
    /*List of home guys*/
    private ArrayList<MobilityBindingEntry>mobilityBindingEntries = null;
    /*List of guest guys*/
    private ArrayList<VisitorEntry>visitorEntries = null;
    
    public Agent(String ip) {
        this.ip = ip;
    }
    
  //  public void sendAgentAdvertisment
      

    /**
     * @return the ip
     */
    public String getIp() {
        return ip;
    }

    /**
     * @param ip the ip to set
     */
    public void setIp(String ip) {
        this.ip = ip;
    }

    /**
     * @return the mobilityBindingEntries
     */
    public ArrayList<MobilityBindingEntry> getMobilityBindingEntries() {
        return mobilityBindingEntries;
    }

    /**
     * @param mobilityBindingEntries the mobilityBindingEntries to set
     */
    public void setMobilityBindingEntries(ArrayList<MobilityBindingEntry> mobilityBindingEntries) {
        this.mobilityBindingEntries = mobilityBindingEntries;
    }

    /**
     * @return the visitorEntries
     */
    public ArrayList<VisitorEntry> getVisitorEntries() {
        return visitorEntries;
    }

    /**
     * @param visitorEntries the visitorEntries to set
     */
    public void setVisitorEntries(ArrayList<VisitorEntry> visitorEntries) {
        this.visitorEntries = visitorEntries;
    }

     /**
     * @param visitorEntry the visitorEntry to add
     */
    public void addVisitorEntry(VisitorEntry visitorEntry) {
        if(this.visitorEntries == null)
            visitorEntries = new ArrayList<VisitorEntry>();
        visitorEntries.add(visitorEntry);
        setVisitorEntries(visitorEntries);
    }

     /**
     * @param mobilityBindingEntry the visitorEntry to add
     */
    public void addMobilityBindingEntry(MobilityBindingEntry mobilityBindingEntry) {
        if(this.mobilityBindingEntries == null)
            mobilityBindingEntries = new ArrayList<MobilityBindingEntry>();
        mobilityBindingEntries.add(mobilityBindingEntry);
        setMobilityBindingEntries(mobilityBindingEntries);
    }

      /**
     * @param mobilityBindingEntry the visitorEntry to remove
     */
    public void removeMobilityBindingEntry(MobilityBindingEntry mobilityBindingEntry) {
        if(this.mobilityBindingEntries.contains(mobilityBindingEntry)) {
          mobilityBindingEntries.remove(mobilityBindingEntry);
          setMobilityBindingEntries(mobilityBindingEntries);
        }
    }

     /**
     * @param visitorEntry the visitorEntry to remove
     */
    public void removeVisitorEntry(VisitorEntry visitorEntry) {
        if(this.visitorEntries.contains(visitorEntry)) {
          visitorEntries.remove(visitorEntry);
          setVisitorEntries(visitorEntries);
        }
    }

}
